package com.kantboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;


// 开启异步，用于@Async等注解
@EnableAsync
// 开启缓存，用于@Cacheable等注解
@EnableCaching
// 开启JPA审计，用于@CreatedDate等注解
@EnableJpaAuditing
// 开启JPA扫描，用于@Entity等注解
@EntityScan
// 开启JPA仓库扫描，用于@EnableJpaRepositories等注解
@EnableJpaRepositories
// 开启servlet组件扫描，用于@WebServlet等注解
@ServletComponentScan
@SpringBootApplication

public class KantbootStartApplication {

    /**
     * 开启代理
     */
    private static void openProperty(){
        // 开启代理
        System.setProperty("https.proxyHost", "127.0.0.1");
        System.setProperty("https.proxyPort", "33210");
        System.setProperty("http.proxyHost", "127.0.0.1");
        System.setProperty("http.proxyPort", "33210");
        System.setProperty("all_proxy", "socks5://127.0.0.1:33211");
    }

    public static void main(String[] args) {

        // 开启代理
//        openProperty();
        SpringApplication.run(KantbootStartApplication.class, args);
    }

}
